<template>
  <div>
    <form action="/">
      <van-search
        v-model="value"
        show-action
        placeholder="请输入搜索关键词"
        @search="onSearch"
        @cancel="onCancel"
      />
    </form>

    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item>1</van-swipe-item>
      <van-swipe-item>2</van-swipe-item>
      <van-swipe-item>3</van-swipe-item>
      <van-swipe-item>4</van-swipe-item>
    </van-swipe>

    <van-tabbar v-model="active" :fixed="false">
      <van-tabbar-item name="home" icon="home-o">整租</van-tabbar-item>
      <van-tabbar-item name="search" icon="search">合租</van-tabbar-item>
      <van-tabbar-item name="friends" icon="friends-o">地图找房</van-tabbar-item>
      <van-tabbar-item name="setting" icon="setting-o">去出租</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: "",
  props: {},
  data() {
    return {
      value: "",
      active: "home",
    };
  },
  methods: {
    onSearch(val) {
      Toast(val);
      console.log(val);
    },
    onCancel() {
      Toast("位置");
    },
  },
};
</script>

<style scoped lang="less">
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
</style>
